package com.ibm.testbed.script.util;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;

public class Layout {

	public static Composite createParentComposite(Composite parent,int numColumns){
		Composite composite = new Composite(parent, SWT.NULL);
		GridLayout layout = new GridLayout();
		layout.marginWidth = 12;
		layout.numColumns = numColumns;
		composite.setLayout(layout);
		
		composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL
				| GridData.HORIZONTAL_ALIGN_FILL));

		composite.setFont(parent.getFont());
		return composite;
	}
	
	public static Composite createComposite(Composite parent,int numColumns){
		Composite composite = new Composite(parent, 0);
		GridLayout layout = new GridLayout();
		layout.marginWidth = 0;
		layout.numColumns = numColumns;
		composite.setLayout(layout);
		return composite;
	}
	
	public static Group createTableGroup(Composite parent,String text){
		Group group = new Group(parent, 0);
		group.setText(text);

		GridLayout layout = new GridLayout();
		layout.marginWidth = 10;
		layout.numColumns = 1;
		group.setLayout(layout);
		return group;
	}
	
	public static GridData getEditAttributeTextGriteData(){
		GridData data = new GridData(768);
		data.widthHint = 180;
		return data;
	}
}
